import { post } from '../ck/plugin/axios'

//教室管理的网络请求
class ClassroomManage {
  static async addClassroom ({
    CampusID,
    RoomName,
    Address,
    Introduce
  }) {
    return post('api/Manage/ClassRoom/Add', {
      CampusID,
      RoomName,
      Address,
      Introduce
    })
  }

  //获取校区信息
  static async getCampusInfo () {
    return post('api/Manage/Campus/PageSearchList')
  }



  //教室列表
  static async getClassroomList ({
    CampusID,
    RoomName,
    Page,
    Limit
  }) {
    return post('api/Manage/ClassRoom/PageSearch', {
      CampusID,
      RoomName,
      Page,
      Limit
    })
  }

  //教室集合
  static async PageSearchList(data){
    return post('api/Manage/ClassRoom/PageSearchList',data)
  }

  //修改教室的启停状态
  static async statusChange (ID, Status) {
    return post('api/Manage/ClassRoom/UpdateStatus', {
      ID,
      Status
    })
  }

  //点击编辑按钮，查询详情
  static async showClassroomDetail(ID){
    return post('api/Manage/ClassRoom/SearchModelDetails',{
      ID
    })
  }

  //点击编辑对话框中的确定按钮，进行教室信息的编辑
  static async editClassroom(ID,{
    CampusID,
    RoomName,
    Address,
    Introduce
  }){
    return post('api/Manage/ClassRoom/Update',{
      ID,
      CampusID,
      RoomName,
      Address,
      Introduce
    })
  }

  //删除教室
  static async deleteClassroom(ID){
    return post('api/Manage/ClassRoom/Delete',{
      ID
    })
  }
}

export default ClassroomManage
